package com.co.ud.icehome.getservice;


import org.mule.RequestContext;
import org.mule.api.MuleEvent;
import org.mule.api.MuleMessage;


public class BuilderMessage {

	private MuleEvent event;

	public MuleMessage recoveryAddress(NodeDevice nodeDevice) {

		event = RequestContext.getEvent();
		MuleMessage message = event.getMessage();
		
		
		System.out.println("nodo es :" + nodeDevice.getIdDevice());
		System.out.println("valor del nodo es :" + nodeDevice.getSensorValue());
		//message = "valor es :"+ nodeDevice.getSensorValue();
		/*message = "<message><user>"+nodeDevice.getIdDevice()+"</user>" +
				  "<sensor>"+nodeDevice.getSensorValue()+"</sensor></message>";*/
		String src="temp="+nodeDevice.getSensorValue();
		
		message.setOutboundProperty("user",nodeDevice.getIdDevice() );
		message.setPayload(src);
		
		
		return message;
	}

}
